<div id="page-content">
    <div class="col-lg-12">
        <div class="panel">
            <div class="panel-heading">
                <h3 class="panel-title" style="text-align:center;">
                    #@installPJaxGoBackBtn()
                    #(o?'编辑':'添加')
                </h3>
            </div>
            <form id="editForm" class="panel-body form-horizontal form-padding">
                <input type="hidden" name="id" value="#(o?o.id:'')">
                <div class="form-group">
                    <label class="col-md-2 control-label">留言评价</label>
                    <div class="col-md-8">
                        <textarea type="text" rows="8" name="remark" class="form-control" placeholder="留言评价" value="">#(o?o.remark:'')</textarea>
                    </div>
                </div>
                <div class="panel-footer">
                    <div class="row">
                        <div class="col-sm-9 col-sm-offset-5">
                            <button class="btn btn-warning" type="reset">重置</button>
                            <button class="btn btn-mint" type="submit" >保存</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    function save(){
        var data = common_ajax.ajaxFunc("/admin/remark/save", $('#editForm').serialize(), "json", null);
        if(data.success){
            pointLion.alertMsg("保存成功!" , "success" , "small" , function(){
                doPjax(ctx+'/admin/remark/getListPage');
            });
        }else{
            pointLion.alertMsg(data.message , "danger" , "small" , function(){
                $(".btn").removeAttr("disabled");
            });
        }
    }
    $(document).ready(function() {
        $('#editForm').bootstrapValidator({
            fields: {
            }
        }).on("success.form.bv", function (e) {
            save();
            return false;
        });
    });
</script>